<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h3>处方列表</h3>
<form action="">
    <input type="text" name="cname">
    <input type="submit" value="搜索">
</form>
<form action="{% url 'add_pres' %}">
    <input type="submit" value="新增">
</form>
<br>
<table border="1" cellspacing="0">
    <tr>
        <th>序号</th>
        <th>处方名称</th>
        <th>诊断结果</th>
        <th>诊断医生</th>
        <th>患者</th>
        <th colspan="2">操作</th>
    </tr>
    {% for i in pagex %}
    <tr>
        <td>{{ i.id }}</td>
        <td>{{ i.cname }}</td>
        <td>{{ i.result }}</td>
        <td>{{ i.doctor.truename }}</td>
        <td>{{ i.hname }}</td>
        <td><a href="{% url 'update_pres' i.id %}">修改</a></td>
        <td><a href="{% url 'del_pres' i.id %}">删除</a></td>
    </tr>
    {% endfor %}
</table>
{% if pagex.number > 1 %}
    <a href="{% url 'index_pres' %}?page={{ pagex.number|add:-1 }}&cname={{ cname }}">上一页</a>
{% endif %}
<b>当前页{{ pagex.number }}
    {% if has %}
        </b><a href="{% url 'index_pres' %}?page={{ pagex.number|add:1 }}&cname={{ cname }}">下一页</a>
    {% endif %}
</body>
</html>